package com.javasea.log4j2.log2;

import com.javasea.log4j2.aop.JFLog;
import com.javasea.log4j2.entity.ProviderQuery;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.*;

/**
 * TODO 类功能介绍及重点或容易混淆点的说明。
 *
 * @version 1.0 2023/3/30 17:00 龙小南 新建类[说明]
 * @author: 龙小南
 * @Date: 2023/3/30 17:00
 * @Version 1.0[当前版本号]
 */

@RestController
@RequestMapping("/testLog2")
public class Demo2 {
//    Logger logger = LoggerFactory.getLogger(Demo.class);
    Logger logger = LogManager.getLogger(Demo2.class);

    @PostMapping("/test")
    @JFLog("abcdefg123456")
    public void test(@RequestBody ProviderQuery providerQuery){
        logger.debug("test debug");
        logger.info("test info");
        logger.warn("test warn");
        logger.error("test error");
    }

    @GetMapping("/test2")
    public void test2(){
        logger.debug("test debug");
        logger.info("test info");
        logger.warn("test warn");
        logger.error("test error");
    }
}
